package org.nicocube.airain.app.server;

import java.util.logging.Level;
import java.util.logging.Logger;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.nicocube.airain.domain.client.exception.DomainException;
import org.nicocube.airain.domain.server.dao.DomainDAO;
import org.nicocube.airain.domain.server.storable.GameDateManagerDAO;

public class InitServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;
	private static final Logger log = Logger.getLogger(InitServlet.class.getName());

	@Override
	public void init() throws ServletException {
		super.init();
		try {
			log.info("running init servlet");
			DomainDAO.getDao(GameDateManagerDAO.class).initSingleton();
		} catch (DomainException e) {
			log.log(Level.SEVERE, "cannot initialize cache",e);
		}
	}
}
